package cn.fl.splmsg.controller;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.cmm.base.framework.logger.eum.LogExceptionEnum;
import cn.cmm.base.framework.logger.eum.LogOperEnum;
import com.alibaba.fastjson.JSON;
import fl.constant.facade.framework.constant.BusinessIdConstant;
import fl.spl.facade.framework.constant.SplSystemConstant;
import fl.spl.facade.msg.api.ICreateSingleMsgApiService;
import fl.spl.facade.msg.dto.CreateMsgDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cmm.mid.core.framework.dto.DataResultDTO;
import cmm.mid.core.framework.page.DataResultVO;
import cmm.mid.core.framework.page.KeyValueVO;
import cmm.mid.core.framework.page.ListPageVO;
import cmm.mid.core.framework.page.Pager;
import cmm.user.facade.push.dto.PushDTO;
import cmm.user.facade.system.api.ISysUsrApiService;
import cmm.user.facade.system.dto.LoginCacheDTO;
import cmm.user.facade.system.dto.SysUsrDTO;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.constant.BaseExceptionConstant;
import cn.cmm.base.framework.exception.BaseException;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.cmm.cache.framework.utils.PropertiesCacheUtils;
import cn.fl.customer.service.ICstBscInfoService;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.splmsg.condition.SplBullMsgCfgQueryCondition;
import cn.fl.splmsg.condition.SplBullMsgLMQueryCondition;
import cn.fl.splmsg.constant.SplBullMsgLMConstant;
import cn.fl.splmsg.constant.SplMsgConstant;
import cn.fl.splmsg.service.ISplBullMsgCfgService;
import cn.fl.splmsg.service.ISplBullMsgInfoService;
import cn.fl.splmsg.service.ISplBullMsgLMService;
import cn.fl.splmsg.vo.SplBullMsgCfgVO;
import cn.fl.splmsg.vo.SplBullMsgInfoVO;
import cn.fl.splmsg.vo.SplBullMsgLMVO;
import cn.fl.system.constant.SysLogConstant;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import fl.spl.facade.spl.condition.SplInfoQueryCondition;

/**
 * @Description: 供应商公告消息日志主表 控制层
 */
@Controller
@RequestMapping("/splmsg/splBullMsgLM")
public class SplBullMsgLMController extends BaseController {

	@Autowired
	private ISplBullMsgInfoService splBullMsgInfoService;
	/**
	 * 供应商公告消息日志 服务层BEAN
	 */
	@Autowired
	private ISplBullMsgLMService splBullMsgLMService;
	
	/**
	 * 公告消息配置 服务层BEAN
	 */
	@Autowired
	private ISplBullMsgCfgService splBullMsgCfgService;
	
	@Autowired
	private ICstBscInfoService cstBscInfoService;
	
	/**
	 * sysUsrApiService 服务层BEAN
	 */
	@Autowired
	private ISysUsrApiService sysUsrApiService;

	@Autowired
    private ICreateSingleMsgApiService createSingleMsgApiService;
	
	/**
	 * 到列表页面
	 */
	@RequestMapping(value = "/toListPage.do", method = { RequestMethod.GET})
	public ModelAndView toListPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView mav = new ModelAndView("splmsg/splBullMsgInfo/splBullMsgLMList");
		//添加数据字典查询
		List<KeyValueVO> orgList = this.cstBscInfoService.searchBusinessOrgList();// 事业部
		List<KeyValueVO> publist = splBullMsgLMService.searchCdList(SplBullMsgLMConstant.PUB_STS_CD_CODE);
//		List<KeyValueVO> orgList = splBullMsgLMService.searchCdList(SplBullMsgLMConstant.BU_ORG_CD_CODE);
		mav.addObject("publist", publist);
		mav.addObject("orgList", orgList);
		return mav;
	}
	
	/**
	 * 到新增页面
	 */
	@RequestMapping(value = "/toAddPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toAddPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView mav = new ModelAndView("splmsg/splBullMsgInfo/splBullMsgLMModify");
		this.prepare(request,mav);
		return mav;
	}

	/**
	 * 到修改页面
	 */
	@RequestMapping(value = "/toModifyPage.do", method = { RequestMethod.GET, RequestMethod.POST })
	public ModelAndView toModifyPage(HttpServletRequest request, HttpServletResponse response) {
		ModelAndView mav = new ModelAndView("splmsg/splBullMsgInfo/splBullMsgLMModify");
		this.prepare(request,mav);
		String id=request.getParameter("id");
		if(StringUtils.isEmpty(id)){
			BaseLogUtils.newWebLogger("获取SplBullMsgLM数据,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}
		SplBullMsgLMVO vo = this.splBullMsgLMService.selectById(Long.valueOf(id));
		if(null == vo){
			BaseLogUtils.newWebLogger("获取SplBullMsgLM数据不存在").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}
		SplBullMsgCfgQueryCondition condition = new SplBullMsgCfgQueryCondition();
		condition.setLogId(Long.valueOf(id));
		List<SplBullMsgCfgVO> list = splBullMsgCfgService.searchList(condition);
		JSONArray orgCds = new JSONArray(); 
		String rgnCds = "";
		String splIds = "";
		if(CollectionUtils.isNotEmpty(list)){
			for (int i = 0; i < list.size(); i++) {
				SplBullMsgCfgVO cfgVo = list.get(i);
				if(StringUtils.isNotBlank(cfgVo.getBuOrgCd())){
					orgCds.add(cfgVo.getBuOrgCd());
				}
				if(StringUtils.isNotBlank(cfgVo.getRgnCyCd())){
					rgnCds+=cfgVo.getRgnCyCd()+";";
				}
				if(cfgVo.getSplId()!=null && !"".equals(cfgVo.getSplId().toString())){
					splIds+=cfgVo.getSplId()+";";
				}
			}
		}
		mav.addObject("splBullMsgLMVO", vo);
		mav.addObject("orgCds", orgCds);
		mav.addObject("splIds", StringUtils.isNotBlank(splIds)?splIds.substring(0, splIds.length()-1):"");
		mav.addObject("rgnCds", StringUtils.isNotBlank(rgnCds)?rgnCds.substring(0, rgnCds.length()-1):"");
		mav.addObject("splBullMsgLMId", id);
		return mav;
	}
	
	//加载数据字典数据、传值等 ？
    public void prepare(HttpServletRequest request,ModelAndView mav){
    	List<KeyValueVO> orgList = this.cstBscInfoService.searchBusinessOrgList();// 事业部
    	mav.addObject("orgList", orgList);
    }
	/**
	 * 初始化列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initAlreadSendList.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object initSplBullMsgLMList(HttpServletRequest request, HttpServletResponse response) {
		String currentPage = request.getParameter("page");
		String pageSize = request.getParameter("pagesize");
		Pager page = new Pager();
		if (StringUtils.isNotEmpty(currentPage)) {
			page.setCurrentPage(Integer.parseInt(currentPage));
		}

		if (StringUtils.isNotEmpty(pageSize)) {
			page.setEveryPage(Integer.parseInt(pageSize));
		}
		SplBullMsgLMQueryCondition lmqc = new SplBullMsgLMQueryCondition();
		//设置查询条件
		String msgId = request.getParameter("msgId");
		String pubStsCd = request.getParameter("pubStsCd");
		String buOrgNm = request.getParameter("buOrgNm");
		if (StringUtils.isNotEmpty(msgId)) {
			lmqc.setMsgId(Long.valueOf(msgId));
		}
		if (StringUtils.isNotEmpty(pubStsCd)) {
			lmqc.setPubStsCd(pubStsCd);
		}
		if (StringUtils.isNotEmpty(buOrgNm)) {
			lmqc.setBuOrgNm(buOrgNm);
		}
		page.setCondition(lmqc);
		Pager pager = this.splBullMsgLMService.searchSplBullAlreadySendListPage(page);
		List<SplBullMsgLMVO> list = (List<SplBullMsgLMVO>) pager.getResultList();
		if(CollectionUtils.isNotEmpty(list)){
			for (SplBullMsgLMVO splBullMsgLMVO : list) {
				//查询消息描述
				SplBullMsgInfoVO splBullMsgInfoVO = splBullMsgInfoService.selectById(splBullMsgLMVO.getMsgId());
				if(splBullMsgInfoVO!=null){
					splBullMsgLMVO.setDescr(splBullMsgInfoVO.getDescr());
				}
			}
			for (SplBullMsgLMVO splBullMsgLMVO : list) {
				Long mdfUsrId = splBullMsgLMVO.getCrtUsrId();//修改为创建人
				if(!StringUtils.isEmpty(mdfUsrId)){
					SysUsrDTO sysUsrDTO = sysUsrApiService.selectSysUsrById(mdfUsrId, CurrentThreadContext.getCurrentSysCd(), CurrentThreadContext.getCurrentOrgCd());
					splBullMsgLMVO.setMdfUsrNm(sysUsrDTO.getUsrNm());
				}
			}
		}
		ListPageVO<SplBullMsgLMVO> listPage = new ListPageVO<SplBullMsgLMVO>(list, pager.getTotalCount());
		BaseLogUtils.newWebLogger("初始化已发消息列表页面数据.DATA:"+JSONObject.toJSONString(page)).setLogOperType(LogOperEnum.RESP)
				.setSysCd(CurrentThreadContext.getCurrentSysCd())
				.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
				.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
				.setWarning(false)
				.info();
		return listPage;
	}

	/**
	 * 删除数据
	 */
	@RequestMapping(value = "/removeByIds.do", method = {RequestMethod.POST })
	@ResponseBody
	public DataResultVO removeSplBullMsgLMByIds(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String ids = request.getParameter("ids");
        DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_DELETE_SUCC);
        if (StringUtils.isEmpty(ids)) {
            result.setSuccess(BaseConstant.IS_YESNO_NO);
            result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("删除SplBullMsgLM数据,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
            return result;
        }

        List<Long> idsList = new ArrayList<Long>();
        JSONArray idsArray = JSONArray.parseArray(ids);
        for (Object object : idsArray) {
            idsList.add(Long.valueOf(object.toString()));
        }
		
		try {
			boolean success = this.splBullMsgLMService.removeByIds(idsList);
			if(!success){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_DELETE_FAIL);
				BaseLogUtils.newWebLogger("删除SplBullMsgLM数据失败").setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0001);
			}
			BaseLogUtils.newWebLogger("删除SplBullMsgLM数据成功,ID:"+idsList.toString()).setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();
		} catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("删除SplBullMsgLM数据失败,业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		} catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("删除SplBullMsgLM数据失败,系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 得到一条记录
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getById.do", method = { RequestMethod.GET})
	@ResponseBody
	public Object getSplBullMsgLMById(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		String id = request.getParameter("id");
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_OPERATE_SUCC);
		if(StringUtils.isEmpty(id)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
			BaseLogUtils.newWebLogger("获取SplBullMsgLM数据,主键参数为空").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
			return result;
		}
		try {
			SplBullMsgLMVO vo = this.splBullMsgLMService.selectById(Long.valueOf(id));
			if(null == vo){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_QUERY_DATA_IS_EMPTY);
				BaseLogUtils.newWebLogger("获取SplBullMsgLM数据不存在").setLogOperType(LogOperEnum.REQ)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0001);
			}
			result.setData(vo);
			BaseLogUtils.newWebLogger("获取SplBullMsgLM数据成功").setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setKeys("result", JSONObject.toJSONString(result))
					.info();
		}catch(BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("获取SplBullMsgLM数据失败,业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}catch(Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR);
			BaseLogUtils.newWebLogger("获取SplBullMsgLM数据失败,系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}
	
	/**
	 * 条件查询供应商下拉框
	 * 
	 * @param request
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/getSplList.do", method = { RequestMethod.POST})
	@ResponseBody
	public JSONArray getSplInfoList(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		JSONArray buOrgCds = JSONObject.parseArray(request.getParameter("buOrgCds"));//群发部门
		JSONArray rgnCyCds = JSONObject.parseArray(request.getParameter("rgnCyCds"));//群发市（用于筛选供应商）
		JSONArray rgnPrCds = JSONObject.parseArray(request.getParameter("rgnPrCds"));//群发省（用于筛选供应商）
		SplInfoQueryCondition splqc = new SplInfoQueryCondition();
		if(CollectionUtils.isNotEmpty(buOrgCds)){
			splqc.setBuOrgCds(buOrgCds);
		}
		if(CollectionUtils.isNotEmpty(rgnCyCds)){
			splqc.setRgnCyCds(rgnCyCds);
		}
		if(CollectionUtils.isNotEmpty(rgnPrCds)){
			splqc.setRgnPrCds(rgnPrCds);
		}
		JSONArray resultJa= new JSONArray();
		try {
			 resultJa =  this.splBullMsgLMService.searchSplInfoList(splqc);

			 //BaseLogUtils.info(logger, "getSplList", resultJa.toJSONString());
		}catch(BaseException ex) {
			BaseLogUtils.newWebLogger("获取供应商列表数据失败,业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}catch(Exception ex) {
			BaseLogUtils.newWebLogger("获取供应商列表数据失败,系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return resultJa;
	}
	/**
	 * 新增群发草稿记录
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/add.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object addSplBullMsgLM(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, SysLogConstant.LOG_CMM_ADD_SUCC);
		JSONObject jObject = null;//获取参数
		try {
			jObject = this.getRequestParamAdd(request);//获取参数
			SplBullMsgLMVO entity = (SplBullMsgLMVO) jObject.get("entity");
			//增加验证消息id是否存在
			SplBullMsgInfoVO msgInfo = splBullMsgInfoService.selectById(entity.getMsgId());
			if(msgInfo==null){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("消息ID不存在，请填入正确ID");
				return result;
			}
			entity.setPubStsCd("1");//1 未发布
			Long logId = this.splBullMsgLMService.add(entity);
			List<SplBullMsgCfgVO> splBullMsgCfgVOList = (List<SplBullMsgCfgVO>) jObject.get("splBullMsgCfgVOList");
			if(CollectionUtils.isNotEmpty(splBullMsgCfgVOList)){
				for (SplBullMsgCfgVO splBullMsgCfgVO:splBullMsgCfgVOList) {
					splBullMsgCfgVO.setLogId(logId);
				}
			}
			//插入配置
			Boolean success = splBullMsgCfgService.addSplMsgCfgBatch(splBullMsgCfgVOList, logId);
			result.setId(logId);
			BaseLogUtils.newWebLogger("新增SplBullMsgLM数据成功,ID:"+logId+".DATA:"+JSONObject.toJSONString(jObject.get("entity")))
					.setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();
			BaseLogUtils.newWebLogger("新增SplBullMsgCfg数据成功,成功?:"+success+".DATA:"+JSONObject.toJSONString(jObject.get("splBullMsgCfgVOList")))
					.setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR+ex.getMessage());
			BaseLogUtils.newWebLogger("新增SplBullMsgLM数据失败,业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR+ex.getMessage());
			BaseLogUtils.newWebLogger("新增SplBullMsgLM数据失败,系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}

	/**
	 * 修改
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/modify.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object modifySplBullMsgLM(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES,SysLogConstant.LOG_CMM_UPDATE_SUCC);
		JSONObject jObject = null;//获取参数
		try {
			jObject = this.getRequestParamAdd(request);
			SplBullMsgLMVO entity = (SplBullMsgLMVO) jObject.get("entity");
			//增加验证消息id是否存在
			SplBullMsgInfoVO msgInfo = splBullMsgInfoService.selectById(entity.getMsgId());
			if(msgInfo==null){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo("消息ID不存在，请填入【消息列表】正确ID");
				return result;
			}
			Long logId = Long.valueOf(jObject.get("id").toString());
			List<SplBullMsgCfgVO> splBullMsgCfgVOList = (List<SplBullMsgCfgVO>) jObject.get("splBullMsgCfgVOList");
			if(logId==null){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_DATA_PK_IS_EMPTY);
				BaseLogUtils.newWebLogger("修改SplBullMsgLM信息,主键参数为空").setLogOperType(LogOperEnum.REQ)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0001);
				return result;
			}

			boolean success = this.splBullMsgLMService.modify(entity);
			//插入配置
			success = splBullMsgCfgService.addSplMsgCfgBatch(splBullMsgCfgVOList, logId);
			if(!success){
				result.setSuccess(BaseConstant.IS_YESNO_NO);
				result.setInfo(SysLogConstant.LOG_CMM_UPDATE_FAIL);
				BaseLogUtils.newWebLogger("修改SplBullMsgLM数据失败").setLogOperType(LogOperEnum.REQ)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
						.setWarning(false)
						.warn(LogExceptionEnum.COMMON_CODE_0001);
				return result;
			}
			BaseLogUtils.newWebLogger("修改SplBullMsgLM数据成功.DATA:"+JSONObject.toJSONString(jObject))
					.setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR+ex.getMessage());
			BaseLogUtils.newWebLogger("修改SplBullMsgLM数据失败,业务异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR+ex.getMessage());
			BaseLogUtils.newWebLogger("修改SplBullMsgLM数据失败,系统异常").setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}
	
	/**
	 * 获取请求参数
	 * @param request 请求
	 * @return 
	 */
	@SuppressWarnings("unused")
	private SplBullMsgLMVO getRequestParamForSplBullMsgLM(HttpServletRequest request) throws BaseException{
		//获取参数
		String id = request.getParameter("id");//日志id
		String msgId = request.getParameter("msgId");//消息id
		JSONArray buOrgCds = JSONObject.parseArray(request.getParameter("buOrgCds"));//群发部门
		JSONArray rgnList = JSONObject.parseArray(request.getParameter("rgnList"));//群发地区（用于保存记录）
		
		JSONArray rgnCyCds = JSONObject.parseArray(request.getParameter("rgnCyCds"));//群发市（用于筛选供应商）
		JSONArray rgnPrCds = JSONObject.parseArray(request.getParameter("rgnPrCds"));//群发省（用于筛选供应商）
		//是否发送提示消息（1：是，0：否）
		String isTips = request.getParameter("isTips");
		String pubFlag = request.getParameter("pubFlag");//发布时间
		if(pubFlag.equals(BaseConstant.IS_YESNO_YES)){//立即发布 1是 2 否
			Date pubTm = new Date();
		}
		
		if (StringUtils.isBlank(msgId)) {
			throw new BaseException(BaseExceptionConstant.COMMON_0001, "消息id不能为空");
		}
		
		//验证参数并赋值
		SplBullMsgLMVO entity = new SplBullMsgLMVO();
 		//entity.setSndTotNum(sndTotNum);//发送消息总数
 		//entity.setSndSuccNum(sndSuccNum);//发送成功消息数
 		//entity.setOpnNum(opnNum);//打开消息数
 		//entity.setPubStsCd(pubStsCd);//发布状态（SYS0040）
 		//entity.setPubTm(pubTm);//发布时间
	
		Date tm = new Date();
		if (StringUtils.isNotBlank(id)) {
			entity.setId(Long.valueOf(id));
			entity.setMdfTm(tm);
			entity.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
		}else{
			entity.setCrtTm(tm);
			entity.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
			//entity.setCrtUsrOrgCd(CurrentThreadContext.getCurrentOrgCd());//当前用户组织机构代码
            //entity.setOrgCd(CurrentThreadContext.getCurrentBuOrgCd());//事业部组织机构代码
		}
		
		return entity;
	}
	
	/**
	 * 获取请求参数
	 * @param request 请求
	 * @return 
	 */
	private JSONObject getRequestParamAdd(HttpServletRequest request) throws BaseException{
		//获取参数
		String id = request.getParameter("id");//日志id
		String msgId = request.getParameter("msgId");//消息id
		JSONArray buOrgList = JSONObject.parseArray(request.getParameter("buOrgList"));//群发部门
		JSONArray rgnList = JSONObject.parseArray(request.getParameter("rgnList"));//群发地区（用于保存记录）
		JSONArray splList = JSONObject.parseArray(request.getParameter("splList"));//群发商家id
		List<SplBullMsgCfgVO> splBullMsgCfgVOList = new ArrayList<SplBullMsgCfgVO>();
		if(CollectionUtils.isNotEmpty(buOrgList)){//事业部不为空
			for (int i = 0; i < buOrgList.size(); i++) {
				SplBullMsgCfgVO cfgVo = new SplBullMsgCfgVO();
				JSONObject orgJo = (JSONObject) buOrgList.get(i);
				cfgVo.setLogId(StringUtils.isBlank(id)?null:Long.valueOf(id));
				cfgVo.setBuOrgCd(orgJo.getString("buOrgCd"));
				cfgVo.setBuOrgNm(orgJo.getString("buOrgNm"));
				splBullMsgCfgVOList.add(cfgVo);
			}
		}
		
		if(CollectionUtils.isNotEmpty(rgnList)){//区域不为空
			for (int i = 0; i < rgnList.size(); i++) {
				SplBullMsgCfgVO cfgVo = new SplBullMsgCfgVO();
				JSONObject jo = (JSONObject) rgnList.get(i);
				cfgVo.setLogId(StringUtils.isBlank(id)?null:Long.valueOf(id));
				cfgVo.setRgnPrCd(jo.getString("rgnPrCd"));
				cfgVo.setRgnPrNm(jo.getString("rgnPrNm"));
				cfgVo.setRgnCyCd(jo.getString("rgnCyCd"));
				cfgVo.setRgnCyNm(jo.getString("rgnCyNm"));
				splBullMsgCfgVOList.add(cfgVo);
			}
		}
		
		if(CollectionUtils.isNotEmpty(splList)){//商家不为空
			for (int i = 0; i < splList.size(); i++) {
				SplBullMsgCfgVO cfgVo = new SplBullMsgCfgVO();
				JSONObject splJo;
				try {
					splJo = (JSONObject) splList.get(i);
					cfgVo.setLogId(StringUtils.isBlank(id)?null:Long.valueOf(id));
					cfgVo.setSplId(Long.valueOf(splJo.getString("splId")));
					cfgVo.setSplNm(splJo.getString("splNm"));
				} catch (Exception e) {
					String splId = (String) splList.get(i);
					cfgVo.setSplId(Long.valueOf(splId));
				}
				splBullMsgCfgVOList.add(cfgVo);
			}
		}
		//是否发送提示消息（1：是，0：否）
		String isTips = request.getParameter("isTips");
		String pubFlag = request.getParameter("pubFlag");//发布时间
		Date pubTm = null;
		if(StringUtils.isNotBlank(pubFlag) && pubFlag.equals(BaseConstant.IS_YESNO_YES)){//立即发布 1是 0 否
			pubTm = new Date();
		}
		
		if (StringUtils.isBlank(msgId)) {
			throw new BaseException(BaseExceptionConstant.COMMON_0001, "消息id不能为空");
		}
		
		//验证参数并赋值
		SplBullMsgLMVO entity = new SplBullMsgLMVO();
// 		entity.setSndTotNum(sndTotNum);//发送消息总数
// 		entity.setSndSuccNum(sndSuccNum);//发送成功消息数
// 		entity.setOpnNum(opnNum);//打开消息数
// 		entity.setPubStsCd(pubStsCd);//发布状态（SYS0040）
 		entity.setPubTm(pubTm);//发布时间
 		entity.setIsTips(Integer.valueOf(isTips));
 		entity.setMsgId(Long.valueOf(msgId));
		Date tm = new Date();
		if (StringUtils.isNotBlank(id)) {
			entity.setId(Long.valueOf(id));//日志id
			entity.setMdfTm(tm);
			entity.setMdfUsrId(CurrentThreadContext.getCurrentUserId());
		}else{
			entity.setCrtTm(tm);
			entity.setCrtUsrId(CurrentThreadContext.getCurrentUserId());
		}
		JSONObject jo = new JSONObject();
		jo.put("entity", entity);
		jo.put("splBullMsgCfgVOList", splBullMsgCfgVOList);
		jo.put("id", id);
		return jo;
	}
	
	/**
	 * 根据所选发送范围发布消息给供应商员工
	 */
	@RequestMapping(value = "/pushMessage.do", method = { RequestMethod.POST })
	@ResponseBody
	public Object pushMessage(HttpServletRequest request, HttpServletResponse response) throws BaseException {
		DataResultVO result = new DataResultVO(BaseConstant.IS_YESNO_YES, "发布成功");
		List<Object> buOrgCds = JSONObject.parseArray(request.getParameter("buOrgCds"));//群发部门
		List<Object> rgnCyCds = JSONObject.parseArray(request.getParameter("rgnCyCds"));//群发市（用于筛选供应商）
		List<Object> rgnPrCds = JSONObject.parseArray(request.getParameter("rgnPrCds"));//群发省（用于筛选供应商）
		List<Object> splIdsParm = JSONObject.parseArray(request.getParameter("splIds"));//群供应商ids
		String msgId = request.getParameter("msgId");
		Long logId = Long.valueOf(request.getParameter("logId"));
		if(StringUtils.isEmpty(msgId)){
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo("消息id不能为空");
		}
		try {
			//查询消息内容
			SplBullMsgInfoVO splBullMsgInfoVO= splBullMsgInfoService.selectById(Long.valueOf(msgId));
			BaseLogUtils.newWebLogger("查询结果,splBullMsgInfoVo=>" + JSON.toJSONString(splBullMsgInfoVO))
					.setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();
			List<String> loginNm = new ArrayList<String>();
			SplBullMsgLMQueryCondition condition = new SplBullMsgLMQueryCondition();
			//condition.setBuOrgCds(buOrgCds);
			//condition.setRgnPrCds(rgnPrCds);
			//condition.setRgnCyCds(rgnCyCds);
			condition.setSplIds(splIdsParm);
			List<SplBullMsgLMVO> lmVoList = this.splBullMsgLMService.searchSplBullPushList(condition);
			BaseLogUtils.newWebLogger("查询结果,lmVoList=>" + JSON.toJSONString(lmVoList))
					.setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();

            List<String> userList = new ArrayList<>();

			if(CollectionUtils.isNotEmpty(lmVoList)){
				for (SplBullMsgLMVO splBullMsgLMVO:lmVoList) {
					loginNm.add(splBullMsgLMVO.getSplUsrNm());
					userList.add(splBullMsgLMVO.getUsrId().toString());
				}
			}

            CreateMsgDTO msgDTO = new CreateMsgDTO();
            msgDTO.setSendRange(1);//发送范围(0:全部；1:按用户)
            msgDTO.setJumpType(1004);//跳转类型(0:无跳转; 1:内部H5页; 2:外部浏览器; 3:用户被踢下线; 1001:首页——电台Tab; 1002:首页——我的 Tab; 1003:首页——生意 Tab; 1004:系统消息列表页; 1100:图文详情页; 1101:内容详情页; 1102:内容号详情页; 1103:消息详情页; 1201:电台直播间; 1202:节目详情页; 1301:群聊页面; 1401:他人主页; 1402:主持人主页; 1403:我的运币; 1404:我的积分; 1405:我的特权; 1406:我的里程;)
            msgDTO.setUserList(userList);//接收消息用户集合(发送范围为1时，必填)
            msgDTO.setType("0");//消息类型(0:无;10:专题;20:电台审核通过;21:电台审核未通过;22:电台开播;23:主播电台开播;30:禁权消息;40:KOL点赞;41:KOL作品评论;42:KOL作品评论;43:KOL审核通过;44:KOL审核未通过)
            msgDTO.setTitle(splBullMsgInfoVO.getTitle());//title
            msgDTO.setContent(splBullMsgInfoVO.getDescr());//内容
            msgDTO.setAppCode("app_sj");//应用类型(app_ds:道上；app_sj:商家；app_zx:在线；app_zs:助手)
            msgDTO.setPushType(0);//推送位置（0:全部；1:站内；2：站外）
            msgDTO.setAppType(0);//app系统类型（0:全部；1：安卓；2:ios）
            msgDTO.setNoticeType(1);//通知类型(0:系统通知；1：活动通知)

            DataResultDTO msg = this.createSingleMsgApiService.createMsg(msgDTO);
			BaseLogUtils.newWebLogger("pushMessage,发布消息成功?:"+ (1 == msg.getSuccess()) +".DATA:"+JSONObject.toJSONString(msg))
					.setLogOperType(LogOperEnum.RESP)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.info();

            /*List<LoginCacheDTO> cacheList= new ArrayList<LoginCacheDTO>();
			Map<String,LoginCacheDTO> usrMap = this.splBullMsgLMService.getLoginCahceDTO(loginNm);
            BaseLogUtils.info(logger, "pushMessage", "查询结果,usrMap=>" + JSON.toJSONString(usrMap));
			for (Map.Entry<String,LoginCacheDTO> entry : usrMap.entrySet()) {
				cacheList.add(entry.getValue());
			}*/
			//int size = cacheList.size();//发送总记录数
			int size = userList.size();//发送总记录数
			//BaseLogUtils.info(logger, "pushMessage", "推送友盟消息总数==="+size);

			SplBullMsgLMVO msgLm = new SplBullMsgLMVO();
			msgLm.setId(logId);
			msgLm.setPubTm(new Date());
			msgLm.setPubStsCd("4");//已发布
			msgLm.setSndSuccNum(Long.valueOf(size));
			boolean success = this.splBullMsgLMService.modify(msgLm);
			/*int maxCount = 450;
			List<LoginCacheDTO>  temp;
			if (size <= maxCount) {
				// 直接调用接口
				this.toPushMessage(cacheList,splBullMsgInfoVO);
			} else {
				int count = size / maxCount;// 总的循环次数
				if (count % maxCount > 0) {
					count++;
				}
				for (int i = 0; i < count; i++) {
					temp = new ArrayList<LoginCacheDTO>();
					for (int j = 0; j < maxCount; i++) {
						temp.add(cacheList.get(i * maxCount + j));
					}
					// 调用接口
					this.toPushMessage(temp,splBullMsgInfoVO);
					temp.clear();
				}
			}
			BaseLogUtils.info(logger, "pushMessage", "pushMessage,发布消息成功?:"+success+".DATA:"+JSONObject.toJSONString(loginNm), CurrentThreadContext.getCurrentUserName());*/
		}catch (BaseException ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR+ex.getMessage());
			BaseLogUtils.newWebLogger("pushMessage,发布消息.DATA:"+JSONObject.toJSONString(splIdsParm)).setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.warn(LogExceptionEnum.COMMON_CODE_0001);
		}catch (Exception ex) {
			result.setSuccess(BaseConstant.IS_YESNO_NO);
			result.setInfo(SysLogConstant.LOG_CMM_SYS_ERROR+ex.getMessage());
			BaseLogUtils.newWebLogger("pushMessage,发布消息.DATA:"+JSONObject.toJSONString(splIdsParm)).setLogOperType(LogOperEnum.REQ)
					.setSysCd(CurrentThreadContext.getCurrentSysCd())
					.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
					.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
					.setWarning(false)
					.setThrowable(ex)
					.error(LogExceptionEnum.COMMON_CODE_0099);
		}
		return result;
	}
	
	private Object toPushMessage(List<LoginCacheDTO> list,SplBullMsgInfoVO splBullMsgInfoVO)  throws BaseException {
		//--------------返回消息内容json------------------
		JSONObject resultJo = new JSONObject();
		resultJo.put("content", splBullMsgInfoVO.getDescr());
		resultJo.put("title", splBullMsgInfoVO.getTitle());
		resultJo.put("date", new Date());
		resultJo.put("type", 1);//是否最新消息（前台显示标识）
		resultJo.put("bullType", 1);//1 公告 2 通知
		//---------------------------------------------
		String androidTokens = "";
		String iosTokens = "";
		if(CollectionUtils.isNotEmpty(list)){
			for (LoginCacheDTO loginCacheDTO : list) {
				if(null != loginCacheDTO.getOpTypCd()&& "2".equals(loginCacheDTO.getOpTypCd())){//安卓
					androidTokens+=loginCacheDTO.getPushId()+",";
				}else if(null != loginCacheDTO.getOpTypCd()&& "1".equals(loginCacheDTO.getOpTypCd())){//ios
					iosTokens+=loginCacheDTO.getPushId()+",";
				}
			}
			//安卓推送
			if(StringUtils.isNotEmpty(androidTokens) && !"".equals(androidTokens.toString())){
				PushDTO adPushdto = new PushDTO();
				adPushdto.setAppKey(PropertiesCacheUtils.getProperty(SplMsgConstant.SHOP_ANDROID_UMENG_APPKEY));
				adPushdto.setAppMasterSecret(PropertiesCacheUtils.getProperty(SplMsgConstant.SHOP_ANDROID_UMENG_APPMASTERSECRET));
				adPushdto.setDeviceToken(androidTokens.substring(0,androidTokens.length()-1));
				adPushdto.setChnCd("1");//渠道
				adPushdto.setMsgTypCd("1");//1通知 2 消息
				adPushdto.setTicker(splBullMsgInfoVO.getTitle());
				adPushdto.setTitle(splBullMsgInfoVO.getTitle());
				adPushdto.setOsCd("1");//1安卓
				adPushdto.setDescription("androidDescription");
				adPushdto.setCustomValue(resultJo.toJSONString());
				adPushdto.setContent(splBullMsgInfoVO.getDescr());
				adPushdto.setAfterOpen("go_custom");
				DataResultDTO rdto = this.splBullMsgLMService.pushToDeviceTokenList(adPushdto);
				BaseLogUtils.newWebLogger("androidParam ===="+JSONObject.toJSONString(adPushdto) + "androidResult===="+JSONObject.toJSONString(rdto))
						.setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
						.setWarning(false)
						.info();
			}
			if(StringUtils.isNotEmpty(iosTokens) && !"".equals(iosTokens.toString())){
				//ios推送
				PushDTO pushdto = new PushDTO();
				pushdto.setAppKey(PropertiesCacheUtils.getProperty(SplMsgConstant.SHOP_IOS_UMENG_APPKEY));
				pushdto.setAppMasterSecret(PropertiesCacheUtils.getProperty(SplMsgConstant.SHOP_IOS_UMENG_APPMASTERSECRET));
				pushdto.setDeviceToken(iosTokens.substring(0, iosTokens.length()-1));
				pushdto.setChnCd("1");//渠道
				pushdto.setMsgTypCd("1");//1通知 2 消息
				pushdto.setTicker(splBullMsgInfoVO.getTitle());
				pushdto.setTitle(splBullMsgInfoVO.getTitle());
				pushdto.setOsCd("2");//2IOS
				pushdto.setDescription("Description");
				pushdto.setCustomValue(resultJo.toJSONString());
				pushdto.setContent(splBullMsgInfoVO.getDescr());
				pushdto.setAfterOpen("go_custom");
				pushdto.setCustomKey("customKey");
				DataResultDTO iosdto = this.splBullMsgLMService.pushToDeviceTokenList(pushdto);
				BaseLogUtils.newWebLogger("iosParam ===="+JSONObject.toJSONString(pushdto) + "iosResult===="+JSONObject.toJSONString(iosdto))
						.setLogOperType(LogOperEnum.RESP)
						.setSysCd(CurrentThreadContext.getCurrentSysCd())
						.setChannelCd(SplSystemConstant.FL_WEB_CHL_CD)
						.setBussinessId(BusinessIdConstant.LOG_SPL_MANAGER_CD)
						.setWarning(false)
						.info();
			}
		}
		return null;
	}
}

